package com.semidata.trp.decision.job;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.semidata.rtd.core.http.server.HttpSession;
import com.semidata.rtd.core.job.JobContext;
import com.semidata.trp.decision.business.BudgetData;
import com.semidata.trp.decision.business.BusinessData;
import com.semidata.trp.decision.business.Position;
import com.semidata.trp.decision.business.Resource;
import com.semidata.trp.decision.filter.FilterResult;
import com.semidata.trp.decision.request.Request;
import com.semidata.trp.decision.response.Response;
import com.semidata.trp.decision.select.SelectResult;

public class DecisionJobContext implements JobContext {

	private HttpSession session;
	private BusinessData businessData;
	private BudgetData budgetData;
	private Request request;
	private Response response;
	private Resource resource;
	private Position position;
	private Double price;
	private SelectResult selectResult;
	private String businessLog;
	private Map<String, Integer> frequency;
	private List<FilterResult> filterResults;
	private boolean hasDynamicBid;

	public DecisionJobContext(HttpSession session, BusinessData businessData,
	        BudgetData budgetData) {
		this.session = session;
		this.businessData = businessData;
		this.budgetData = budgetData;
		this.request = new Request();
		this.response = new Response();
		this.frequency = new HashMap<>();
		this.price = 0.0;
		this.resource = null;
		this.position = null;
		this.filterResults = null;
		this.selectResult = null;
		this.hasDynamicBid = false;

	}

	public Map<String, Integer> getFrequency() {
		return frequency;
	}

	public void setFrequency(Map<String, Integer> frequency) {
		this.frequency = frequency;
	}

	public HttpSession getHttpSession() {
		return session;
	}
	
	public boolean isHasDynamicBid() {
		return hasDynamicBid;
	}

	public void setHasDynamicBid(boolean hasDynamicBid) {
		this.hasDynamicBid = hasDynamicBid;
	}

	public Request getRequest() {
		return request;
	}

	public Response getResponse() {
		return response;
	}

	public BusinessData getBusinessData() {
		return businessData;
	}

	public Resource getResource() {
		return resource;
	}

	public void setResource(Resource resource) {
		this.resource = resource;
	}

	public Position getPosition() {
		return position;
	}

	public void setPosition(Position position) {
		this.position = position;
	}

	public SelectResult getSelectResult() {
		return selectResult;
	}

	public void setSelectResult(SelectResult selectResult) {
		this.selectResult = selectResult;
	}

	public String getBusinessLog() {
		return businessLog;
	}

	public void setBusinessLog(String businessLog) {
		this.businessLog = businessLog;
	}

	public BudgetData getBudgetData() {
		return budgetData;
	}

	public Double getPrice() {
		return price;
	}

	public void setPrice(Double price) {
		this.price = price;
	}

	public List<FilterResult> getFilterResults() {
		return filterResults;
	}

	public void setFilterResults(List<FilterResult> filterResults) {
		this.filterResults = filterResults;
	}

}
